<?php


abstract class BaseConvertSongPeer {

	
	const DATABASE_NAME = 'propel';

	
	const TABLE_NAME = 'convert_song';

	
	const CLASS_DEFAULT = 'lib.model.ConvertSong';

	
	const NUM_COLUMNS = 52;

	
	const NUM_LAZY_LOAD_COLUMNS = 0;


	
	const ID = 'convert_song.ID';

	
	const USER_ID = 'convert_song.USER_ID';

	
	const BEAT_ID = 'convert_song.BEAT_ID';

	
	const ARTIST = 'convert_song.ARTIST';

	
	const COMPOSER = 'convert_song.COMPOSER';

	
	const ALBUM = 'convert_song.ALBUM';

	
	const LYRICS = 'convert_song.LYRICS';

	
	const GENRE = 'convert_song.GENRE';

	
	const BITRATE = 'convert_song.BITRATE';

	
	const DURATION = 'convert_song.DURATION';

	
	const CREATED_DATETIME = 'convert_song.CREATED_DATETIME';

	
	const SONG_ID = 'convert_song.SONG_ID';

	
	const SONG_NAME = 'convert_song.SONG_NAME';

	
	const PUBLISH_DATE = 'convert_song.PUBLISH_DATE';

	
	const PUBLISHER = 'convert_song.PUBLISHER';

	
	const COMPOSER_ID = 'convert_song.COMPOSER_ID';

	
	const COMPOSER_NAME = 'convert_song.COMPOSER_NAME';

	
	const ARTIST1_ID = 'convert_song.ARTIST1_ID';

	
	const ARTIST1_NAME = 'convert_song.ARTIST1_NAME';

	
	const ARTIST2_ID = 'convert_song.ARTIST2_ID';

	
	const ARTIST2_NAME = 'convert_song.ARTIST2_NAME';

	
	const ARTIST3_ID = 'convert_song.ARTIST3_ID';

	
	const ARTIST3_NAME = 'convert_song.ARTIST3_NAME';

	
	const ALBUM_ID = 'convert_song.ALBUM_ID';

	
	const ALBUM_NAME = 'convert_song.ALBUM_NAME';

	
	const TRACK_NO = 'convert_song.TRACK_NO';

	
	const GENRE_ID = 'convert_song.GENRE_ID';

	
	const SONG_FORMAT = 'convert_song.SONG_FORMAT';

	
	const CONVERT_BEGIN = 'convert_song.CONVERT_BEGIN';

	
	const CONVERT_END = 'convert_song.CONVERT_END';

	
	const CONVERT_STATUS = 'convert_song.CONVERT_STATUS';

	
	const CONVERT_REMARK = 'convert_song.CONVERT_REMARK';

	
	const CONVERT_PATH_SOURCE = 'convert_song.CONVERT_PATH_SOURCE';

	
	const CONVERT_PATH_DESTINATION = 'convert_song.CONVERT_PATH_DESTINATION';

	
	const CONVERT_OPTION_QUALITY = 'convert_song.CONVERT_OPTION_QUALITY';

	
	const CONVERT_OPTION_BITRATE = 'convert_song.CONVERT_OPTION_BITRATE';

	
	const CONVERT_OPTION_DURATION = 'convert_song.CONVERT_OPTION_DURATION';

	
	const CONVERT_OPTION_VOLUME = 'convert_song.CONVERT_OPTION_VOLUME';

	
	const CONVERT_OUTPUT_BITRATE = 'convert_song.CONVERT_OUTPUT_BITRATE';

	
	const CONVERT_OUTPUT_DURATION = 'convert_song.CONVERT_OUTPUT_DURATION';

	
	const DESCRIPTION = 'convert_song.DESCRIPTION';

	
	const TAG = 'convert_song.TAG';

	
	const LANGUAGE = 'convert_song.LANGUAGE';

	
	const LANGUAGE_ID = 'convert_song.LANGUAGE_ID';

	
	const DELETED = 'convert_song.DELETED';

	
	const SPECTRUM_PATH = 'convert_song.SPECTRUM_PATH';

	
	const SPECTRUM_WIDTH = 'convert_song.SPECTRUM_WIDTH';

	
	const CHECKNUM = 'convert_song.CHECKNUM';

	
	const CONVERT_PRIORITY = 'convert_song.CONVERT_PRIORITY';

	
	const CLIP_ID = 'convert_song.CLIP_ID';

	
	const IS_UPLOAD = 'convert_song.IS_UPLOAD';

	
	const IS_SYSCHRONIZE = 'convert_song.IS_SYSCHRONIZE';

	
	private static $phpNameMap = null;


	
	private static $fieldNames = array (
		BasePeer::TYPE_PHPNAME => array ('Id', 'UserId', 'BeatId', 'Artist', 'Composer', 'Album', 'Lyrics', 'Genre', 'Bitrate', 'Duration', 'CreatedDatetime', 'SongId', 'SongName', 'PublishDate', 'Publisher', 'ComposerId', 'ComposerName', 'Artist1Id', 'Artist1Name', 'Artist2Id', 'Artist2Name', 'Artist3Id', 'Artist3Name', 'AlbumId', 'AlbumName', 'TrackNo', 'GenreId', 'SongFormat', 'ConvertBegin', 'ConvertEnd', 'ConvertStatus', 'ConvertRemark', 'ConvertPathSource', 'ConvertPathDestination', 'ConvertOptionQuality', 'ConvertOptionBitrate', 'ConvertOptionDuration', 'ConvertOptionVolume', 'ConvertOutputBitrate', 'ConvertOutputDuration', 'Description', 'Tag', 'Language', 'LanguageId', 'Deleted', 'SpectrumPath', 'SpectrumWidth', 'Checknum', 'ConvertPriority', 'ClipId', 'IsUpload', 'IsSyschronize', ),
		BasePeer::TYPE_COLNAME => array (ConvertSongPeer::ID, ConvertSongPeer::USER_ID, ConvertSongPeer::BEAT_ID, ConvertSongPeer::ARTIST, ConvertSongPeer::COMPOSER, ConvertSongPeer::ALBUM, ConvertSongPeer::LYRICS, ConvertSongPeer::GENRE, ConvertSongPeer::BITRATE, ConvertSongPeer::DURATION, ConvertSongPeer::CREATED_DATETIME, ConvertSongPeer::SONG_ID, ConvertSongPeer::SONG_NAME, ConvertSongPeer::PUBLISH_DATE, ConvertSongPeer::PUBLISHER, ConvertSongPeer::COMPOSER_ID, ConvertSongPeer::COMPOSER_NAME, ConvertSongPeer::ARTIST1_ID, ConvertSongPeer::ARTIST1_NAME, ConvertSongPeer::ARTIST2_ID, ConvertSongPeer::ARTIST2_NAME, ConvertSongPeer::ARTIST3_ID, ConvertSongPeer::ARTIST3_NAME, ConvertSongPeer::ALBUM_ID, ConvertSongPeer::ALBUM_NAME, ConvertSongPeer::TRACK_NO, ConvertSongPeer::GENRE_ID, ConvertSongPeer::SONG_FORMAT, ConvertSongPeer::CONVERT_BEGIN, ConvertSongPeer::CONVERT_END, ConvertSongPeer::CONVERT_STATUS, ConvertSongPeer::CONVERT_REMARK, ConvertSongPeer::CONVERT_PATH_SOURCE, ConvertSongPeer::CONVERT_PATH_DESTINATION, ConvertSongPeer::CONVERT_OPTION_QUALITY, ConvertSongPeer::CONVERT_OPTION_BITRATE, ConvertSongPeer::CONVERT_OPTION_DURATION, ConvertSongPeer::CONVERT_OPTION_VOLUME, ConvertSongPeer::CONVERT_OUTPUT_BITRATE, ConvertSongPeer::CONVERT_OUTPUT_DURATION, ConvertSongPeer::DESCRIPTION, ConvertSongPeer::TAG, ConvertSongPeer::LANGUAGE, ConvertSongPeer::LANGUAGE_ID, ConvertSongPeer::DELETED, ConvertSongPeer::SPECTRUM_PATH, ConvertSongPeer::SPECTRUM_WIDTH, ConvertSongPeer::CHECKNUM, ConvertSongPeer::CONVERT_PRIORITY, ConvertSongPeer::CLIP_ID, ConvertSongPeer::IS_UPLOAD, ConvertSongPeer::IS_SYSCHRONIZE, ),
		BasePeer::TYPE_FIELDNAME => array ('id', 'user_id', 'beat_id', 'artist', 'composer', 'album', 'lyrics', 'genre', 'bitrate', 'duration', 'created_datetime', 'song_id', 'song_name', 'publish_date', 'publisher', 'composer_id', 'composer_name', 'artist1_id', 'artist1_name', 'artist2_id', 'artist2_name', 'artist3_id', 'artist3_name', 'album_id', 'album_name', 'track_no', 'genre_id', 'song_format', 'convert_begin', 'convert_end', 'convert_status', 'convert_remark', 'convert_path_source', 'convert_path_destination', 'convert_option_quality', 'convert_option_bitrate', 'convert_option_duration', 'convert_option_volume', 'convert_output_bitrate', 'convert_output_duration', 'description', 'tag', 'language', 'language_id', 'deleted', 'spectrum_path', 'spectrum_width', 'checknum', 'convert_priority', 'clip_id', 'is_upload', 'is_syschronize', ),
		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, )
	);

	
	private static $fieldKeys = array (
		BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'UserId' => 1, 'BeatId' => 2, 'Artist' => 3, 'Composer' => 4, 'Album' => 5, 'Lyrics' => 6, 'Genre' => 7, 'Bitrate' => 8, 'Duration' => 9, 'CreatedDatetime' => 10, 'SongId' => 11, 'SongName' => 12, 'PublishDate' => 13, 'Publisher' => 14, 'ComposerId' => 15, 'ComposerName' => 16, 'Artist1Id' => 17, 'Artist1Name' => 18, 'Artist2Id' => 19, 'Artist2Name' => 20, 'Artist3Id' => 21, 'Artist3Name' => 22, 'AlbumId' => 23, 'AlbumName' => 24, 'TrackNo' => 25, 'GenreId' => 26, 'SongFormat' => 27, 'ConvertBegin' => 28, 'ConvertEnd' => 29, 'ConvertStatus' => 30, 'ConvertRemark' => 31, 'ConvertPathSource' => 32, 'ConvertPathDestination' => 33, 'ConvertOptionQuality' => 34, 'ConvertOptionBitrate' => 35, 'ConvertOptionDuration' => 36, 'ConvertOptionVolume' => 37, 'ConvertOutputBitrate' => 38, 'ConvertOutputDuration' => 39, 'Description' => 40, 'Tag' => 41, 'Language' => 42, 'LanguageId' => 43, 'Deleted' => 44, 'SpectrumPath' => 45, 'SpectrumWidth' => 46, 'Checknum' => 47, 'ConvertPriority' => 48, 'ClipId' => 49, 'IsUpload' => 50, 'IsSyschronize' => 51, ),
		BasePeer::TYPE_COLNAME => array (ConvertSongPeer::ID => 0, ConvertSongPeer::USER_ID => 1, ConvertSongPeer::BEAT_ID => 2, ConvertSongPeer::ARTIST => 3, ConvertSongPeer::COMPOSER => 4, ConvertSongPeer::ALBUM => 5, ConvertSongPeer::LYRICS => 6, ConvertSongPeer::GENRE => 7, ConvertSongPeer::BITRATE => 8, ConvertSongPeer::DURATION => 9, ConvertSongPeer::CREATED_DATETIME => 10, ConvertSongPeer::SONG_ID => 11, ConvertSongPeer::SONG_NAME => 12, ConvertSongPeer::PUBLISH_DATE => 13, ConvertSongPeer::PUBLISHER => 14, ConvertSongPeer::COMPOSER_ID => 15, ConvertSongPeer::COMPOSER_NAME => 16, ConvertSongPeer::ARTIST1_ID => 17, ConvertSongPeer::ARTIST1_NAME => 18, ConvertSongPeer::ARTIST2_ID => 19, ConvertSongPeer::ARTIST2_NAME => 20, ConvertSongPeer::ARTIST3_ID => 21, ConvertSongPeer::ARTIST3_NAME => 22, ConvertSongPeer::ALBUM_ID => 23, ConvertSongPeer::ALBUM_NAME => 24, ConvertSongPeer::TRACK_NO => 25, ConvertSongPeer::GENRE_ID => 26, ConvertSongPeer::SONG_FORMAT => 27, ConvertSongPeer::CONVERT_BEGIN => 28, ConvertSongPeer::CONVERT_END => 29, ConvertSongPeer::CONVERT_STATUS => 30, ConvertSongPeer::CONVERT_REMARK => 31, ConvertSongPeer::CONVERT_PATH_SOURCE => 32, ConvertSongPeer::CONVERT_PATH_DESTINATION => 33, ConvertSongPeer::CONVERT_OPTION_QUALITY => 34, ConvertSongPeer::CONVERT_OPTION_BITRATE => 35, ConvertSongPeer::CONVERT_OPTION_DURATION => 36, ConvertSongPeer::CONVERT_OPTION_VOLUME => 37, ConvertSongPeer::CONVERT_OUTPUT_BITRATE => 38, ConvertSongPeer::CONVERT_OUTPUT_DURATION => 39, ConvertSongPeer::DESCRIPTION => 40, ConvertSongPeer::TAG => 41, ConvertSongPeer::LANGUAGE => 42, ConvertSongPeer::LANGUAGE_ID => 43, ConvertSongPeer::DELETED => 44, ConvertSongPeer::SPECTRUM_PATH => 45, ConvertSongPeer::SPECTRUM_WIDTH => 46, ConvertSongPeer::CHECKNUM => 47, ConvertSongPeer::CONVERT_PRIORITY => 48, ConvertSongPeer::CLIP_ID => 49, ConvertSongPeer::IS_UPLOAD => 50, ConvertSongPeer::IS_SYSCHRONIZE => 51, ),
		BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'user_id' => 1, 'beat_id' => 2, 'artist' => 3, 'composer' => 4, 'album' => 5, 'lyrics' => 6, 'genre' => 7, 'bitrate' => 8, 'duration' => 9, 'created_datetime' => 10, 'song_id' => 11, 'song_name' => 12, 'publish_date' => 13, 'publisher' => 14, 'composer_id' => 15, 'composer_name' => 16, 'artist1_id' => 17, 'artist1_name' => 18, 'artist2_id' => 19, 'artist2_name' => 20, 'artist3_id' => 21, 'artist3_name' => 22, 'album_id' => 23, 'album_name' => 24, 'track_no' => 25, 'genre_id' => 26, 'song_format' => 27, 'convert_begin' => 28, 'convert_end' => 29, 'convert_status' => 30, 'convert_remark' => 31, 'convert_path_source' => 32, 'convert_path_destination' => 33, 'convert_option_quality' => 34, 'convert_option_bitrate' => 35, 'convert_option_duration' => 36, 'convert_option_volume' => 37, 'convert_output_bitrate' => 38, 'convert_output_duration' => 39, 'description' => 40, 'tag' => 41, 'language' => 42, 'language_id' => 43, 'deleted' => 44, 'spectrum_path' => 45, 'spectrum_width' => 46, 'checknum' => 47, 'convert_priority' => 48, 'clip_id' => 49, 'is_upload' => 50, 'is_syschronize' => 51, ),
		BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, )
	);

	
	public static function getMapBuilder()
	{
		include_once 'lib/model/map/ConvertSongMapBuilder.php';
		return BasePeer::getMapBuilder('lib.model.map.ConvertSongMapBuilder');
	}
	
	public static function getPhpNameMap()
	{
		if (self::$phpNameMap === null) {
			$map = ConvertSongPeer::getTableMap();
			$columns = $map->getColumns();
			$nameMap = array();
			foreach ($columns as $column) {
				$nameMap[$column->getPhpName()] = $column->getColumnName();
			}
			self::$phpNameMap = $nameMap;
		}
		return self::$phpNameMap;
	}
	
	static public function translateFieldName($name, $fromType, $toType)
	{
		$toNames = self::getFieldNames($toType);
		$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
		if ($key === null) {
			throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
		}
		return $toNames[$key];
	}

	

	static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
	{
		if (!array_key_exists($type, self::$fieldNames)) {
			throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
		}
		return self::$fieldNames[$type];
	}

	
	public static function alias($alias, $column)
	{
		return str_replace(ConvertSongPeer::TABLE_NAME.'.', $alias.'.', $column);
	}

	
	public static function addSelectColumns(Criteria $criteria)
	{

		$criteria->addSelectColumn(ConvertSongPeer::ID);

		$criteria->addSelectColumn(ConvertSongPeer::USER_ID);

		$criteria->addSelectColumn(ConvertSongPeer::BEAT_ID);

		$criteria->addSelectColumn(ConvertSongPeer::ARTIST);

		$criteria->addSelectColumn(ConvertSongPeer::COMPOSER);

		$criteria->addSelectColumn(ConvertSongPeer::ALBUM);

		$criteria->addSelectColumn(ConvertSongPeer::LYRICS);

		$criteria->addSelectColumn(ConvertSongPeer::GENRE);

		$criteria->addSelectColumn(ConvertSongPeer::BITRATE);

		$criteria->addSelectColumn(ConvertSongPeer::DURATION);

		$criteria->addSelectColumn(ConvertSongPeer::CREATED_DATETIME);

		$criteria->addSelectColumn(ConvertSongPeer::SONG_ID);

		$criteria->addSelectColumn(ConvertSongPeer::SONG_NAME);

		$criteria->addSelectColumn(ConvertSongPeer::PUBLISH_DATE);

		$criteria->addSelectColumn(ConvertSongPeer::PUBLISHER);

		$criteria->addSelectColumn(ConvertSongPeer::COMPOSER_ID);

		$criteria->addSelectColumn(ConvertSongPeer::COMPOSER_NAME);

		$criteria->addSelectColumn(ConvertSongPeer::ARTIST1_ID);

		$criteria->addSelectColumn(ConvertSongPeer::ARTIST1_NAME);

		$criteria->addSelectColumn(ConvertSongPeer::ARTIST2_ID);

		$criteria->addSelectColumn(ConvertSongPeer::ARTIST2_NAME);

		$criteria->addSelectColumn(ConvertSongPeer::ARTIST3_ID);

		$criteria->addSelectColumn(ConvertSongPeer::ARTIST3_NAME);

		$criteria->addSelectColumn(ConvertSongPeer::ALBUM_ID);

		$criteria->addSelectColumn(ConvertSongPeer::ALBUM_NAME);

		$criteria->addSelectColumn(ConvertSongPeer::TRACK_NO);

		$criteria->addSelectColumn(ConvertSongPeer::GENRE_ID);

		$criteria->addSelectColumn(ConvertSongPeer::SONG_FORMAT);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_BEGIN);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_END);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_STATUS);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_REMARK);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_PATH_SOURCE);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_PATH_DESTINATION);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_OPTION_QUALITY);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_OPTION_BITRATE);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_OPTION_DURATION);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_OPTION_VOLUME);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_OUTPUT_BITRATE);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_OUTPUT_DURATION);

		$criteria->addSelectColumn(ConvertSongPeer::DESCRIPTION);

		$criteria->addSelectColumn(ConvertSongPeer::TAG);

		$criteria->addSelectColumn(ConvertSongPeer::LANGUAGE);

		$criteria->addSelectColumn(ConvertSongPeer::LANGUAGE_ID);

		$criteria->addSelectColumn(ConvertSongPeer::DELETED);

		$criteria->addSelectColumn(ConvertSongPeer::SPECTRUM_PATH);

		$criteria->addSelectColumn(ConvertSongPeer::SPECTRUM_WIDTH);

		$criteria->addSelectColumn(ConvertSongPeer::CHECKNUM);

		$criteria->addSelectColumn(ConvertSongPeer::CONVERT_PRIORITY);

		$criteria->addSelectColumn(ConvertSongPeer::CLIP_ID);

		$criteria->addSelectColumn(ConvertSongPeer::IS_UPLOAD);

		$criteria->addSelectColumn(ConvertSongPeer::IS_SYSCHRONIZE);

	}

	const COUNT = 'COUNT(convert_song.ID)';
	const COUNT_DISTINCT = 'COUNT(DISTINCT convert_song.ID)';

	
	public static function doCount(Criteria $criteria, $distinct = false, $con = null)
	{
				$criteria = clone $criteria;

				$criteria->clearSelectColumns()->clearOrderByColumns();
		if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
			$criteria->addSelectColumn(ConvertSongPeer::COUNT_DISTINCT);
		} else {
			$criteria->addSelectColumn(ConvertSongPeer::COUNT);
		}

				foreach($criteria->getGroupByColumns() as $column)
		{
			$criteria->addSelectColumn($column);
		}

		$rs = ConvertSongPeer::doSelectRS($criteria, $con);
		if ($rs->next()) {
			return $rs->getInt(1);
		} else {
						return 0;
		}
	}
	
	public static function doSelectOne(Criteria $criteria, $con = null)
	{
		$critcopy = clone $criteria;
		$critcopy->setLimit(1);
		$objects = ConvertSongPeer::doSelect($critcopy, $con);
		if ($objects) {
			return $objects[0];
		}
		return null;
	}
	
	public static function doSelect(Criteria $criteria, $con = null)
	{
		return ConvertSongPeer::populateObjects(ConvertSongPeer::doSelectRS($criteria, $con));
	}
	
	public static function doSelectRS(Criteria $criteria, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		if (!$criteria->getSelectColumns()) {
			$criteria = clone $criteria;
			ConvertSongPeer::addSelectColumns($criteria);
		}

				$criteria->setDbName(self::DATABASE_NAME);

						return BasePeer::doSelect($criteria, $con);
	}
	
	public static function populateObjects(ResultSet $rs)
	{
		$results = array();
	
				$cls = ConvertSongPeer::getOMClass();
		$cls = Propel::import($cls);
				while($rs->next()) {
		
			$obj = new $cls();
			$obj->hydrate($rs);
			$results[] = $obj;
			
		}
		return $results;
	}
	
	public static function getTableMap()
	{
		return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
	}

	
	public static function getOMClass()
	{
		return ConvertSongPeer::CLASS_DEFAULT;
	}

	
	public static function doInsert($values, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		if ($values instanceof Criteria) {
			$criteria = clone $values; 		} else {
			$criteria = $values->buildCriteria(); 		}

		$criteria->remove(ConvertSongPeer::ID); 

				$criteria->setDbName(self::DATABASE_NAME);

		try {
									$con->begin();
			$pk = BasePeer::doInsert($criteria, $con);
			$con->commit();
		} catch(PropelException $e) {
			$con->rollback();
			throw $e;
		}

		return $pk;
	}

	
	public static function doUpdate($values, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		$selectCriteria = new Criteria(self::DATABASE_NAME);

		if ($values instanceof Criteria) {
			$criteria = clone $values; 
			$comparison = $criteria->getComparison(ConvertSongPeer::ID);
			$selectCriteria->add(ConvertSongPeer::ID, $criteria->remove(ConvertSongPeer::ID), $comparison);

		} else { 			$criteria = $values->buildCriteria(); 			$selectCriteria = $values->buildPkeyCriteria(); 		}

				$criteria->setDbName(self::DATABASE_NAME);

		return BasePeer::doUpdate($selectCriteria, $criteria, $con);
	}

	
	public static function doDeleteAll($con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}
		$affectedRows = 0; 		try {
									$con->begin();
			$affectedRows += BasePeer::doDeleteAll(ConvertSongPeer::TABLE_NAME, $con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	 public static function doDelete($values, $con = null)
	 {
		if ($con === null) {
			$con = Propel::getConnection(ConvertSongPeer::DATABASE_NAME);
		}

		if ($values instanceof Criteria) {
			$criteria = clone $values; 		} elseif ($values instanceof ConvertSong) {

			$criteria = $values->buildPkeyCriteria();
		} else {
						$criteria = new Criteria(self::DATABASE_NAME);
			$criteria->add(ConvertSongPeer::ID, (array) $values, Criteria::IN);
		}

				$criteria->setDbName(self::DATABASE_NAME);

		$affectedRows = 0; 
		try {
									$con->begin();
			
			$affectedRows += BasePeer::doDelete($criteria, $con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public static function doValidate(ConvertSong $obj, $cols = null)
	{
		$columns = array();

		if ($cols) {
			$dbMap = Propel::getDatabaseMap(ConvertSongPeer::DATABASE_NAME);
			$tableMap = $dbMap->getTable(ConvertSongPeer::TABLE_NAME);

			if (! is_array($cols)) {
				$cols = array($cols);
			}

			foreach($cols as $colName) {
				if ($tableMap->containsColumn($colName)) {
					$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
					$columns[$colName] = $obj->$get();
				}
			}
		} else {

		}

		$res =  BasePeer::doValidate(ConvertSongPeer::DATABASE_NAME, ConvertSongPeer::TABLE_NAME, $columns);
    if ($res !== true) {
        $request = sfContext::getInstance()->getRequest();
        foreach ($res as $failed) {
            $col = ConvertSongPeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
            $request->setError($col, $failed->getMessage());
        }
    }

    return $res;
	}

	
	public static function retrieveByPK($pk, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		$criteria = new Criteria(ConvertSongPeer::DATABASE_NAME);

		$criteria->add(ConvertSongPeer::ID, $pk);


		$v = ConvertSongPeer::doSelect($criteria, $con);

		return !empty($v) > 0 ? $v[0] : null;
	}

	
	public static function retrieveByPKs($pks, $con = null)
	{
		if ($con === null) {
			$con = Propel::getConnection(self::DATABASE_NAME);
		}

		$objs = null;
		if (empty($pks)) {
			$objs = array();
		} else {
			$criteria = new Criteria();
			$criteria->add(ConvertSongPeer::ID, $pks, Criteria::IN);
			$objs = ConvertSongPeer::doSelect($criteria, $con);
		}
		return $objs;
	}

} 
if (Propel::isInit()) {
			try {
		BaseConvertSongPeer::getMapBuilder();
	} catch (Exception $e) {
		Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
	}
} else {
			require_once 'lib/model/map/ConvertSongMapBuilder.php';
	Propel::registerMapBuilder('lib.model.map.ConvertSongMapBuilder');
}
